
/**
 * 类的功能层次结构
 */
public class Display {

    private DisplayImpl displayImpl;

    public Display(DisplayImpl displayImpl){
        this.displayImpl = displayImpl;
    }

    protected void open() {
        displayImpl.openImpl();
    }

    protected void print(){
        displayImpl.printImpl();
    }

    protected void close(){
        displayImpl.closeImpl();
    }

    public void display(){
        open();
        print();
        close();
    }

}
